from django.db import models

# Create your models here.

class LdapBaseConf(models.Model):
    # LDAP基础设置
    name = models.CharField(max_length=50,blank=True,null=True, verbose_name="ldap名称", help_text="ldap名称")
    host = models.CharField(max_length=150, blank=False, null=False, verbose_name="ldap地址", help_text="ldap地址")
    port = models.IntegerField(blank=False, null=False, verbose_name="LDAP端口", help_text="LDAP端口")
    admin_dn = models.CharField(max_length=100, blank=False, null=False, verbose_name="管理员DN", help_text="管理员DN")
    admin_password = models.CharField(max_length=100, blank=False, null=False, verbose_name="管理员密码", help_text="管理员密码")
    search_filter = models.CharField(max_length=20, blank=False, null=False, verbose_name="LDAP Search Filter", help_text="LDAP Search Filter")
    scbase = models.CharField(max_length=100, blank=False, null=False, verbose_name="LDAP_SCBASE", help_text="LDAP_SCBASE")

    class Meta:
        verbose_name = "LDAP基础设置"
        verbose_name_plural = verbose_name
        db_table = "ldap_conf"

    def __str__(self):
        return self.name